import { POST, GET } from "../utils/index";

// 管理员登录
interface ILoginData {
    adminname: string,
    password: string
}

export const loginCheckApi = (data: ILoginData) => POST("/admin/login", data);

// 管理员列表
export const getAdminListApi = () => GET("/admin/list");

// 管理员信息
export const getAdminApi = (adminname:string) => GET("/admin/detail",{adminname});

// 添加管理员
interface IAddAdmin {
    adminname: string
    password: string
    role: string
    checkedKeys: string
}

export const addAdminApi = (data: IAddAdmin) => POST("/admin/add", data);

// 删除管理员
interface IRemoveAdin {
    adminid: string
}
export const removeAdminApi = (data: IRemoveAdin) => POST("/admin/delete", data);



// 修改管理员
interface IEditAdmin {
    adminname: string
    password: string
    role: string
    checkedKeys: string
}
export const editAdminApi = (data: IEditAdmin) => POST("/admin/update", data);

// 修改管理员的密码



